% wsuthesis.cls
%
%    Copyright 2010 Daniel Burrows
%
% You may use, modify, and redistribute this file in any way you please, so
% long as this copyright notice is maintained.

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{wsuthesis}

\LoadClassWithOptions{report}

\RequirePackage{graphicx}
\RequirePackage{listings}
\RequirePackage{setspace}
\usepackage{subfigure}

\usepackage{layout}
\oddsidemargin 18pt
\topmargin 18pt
\headheight 0pt
\headsep 0pt
\textheight 614pt
\textwidth 433pt
\marginparsep 9pt
\marginparwidth 72pt
\footskip 42pt

\doublespacing

% \alwayssingle and \endalwayssingle
%
% These macros define an environment for front matter that is always 
% single column even in a double-column document.

\def\alwayssingle{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
     \else \newpage \fi}

\def\endalwayssingle{\if@restonecol\twocolumn \else \newpage \fi}

% For some environments we switch back to single-spacing, also
% provides \dsp in case you need double-spacing where single-spacing
% is otherwise used.
\def\ssp{\def\baselinestretch{1.0}\large\normalsize}
\def\dsp{\def\baselinestretch{1.37}\large\normalsize}

% Set the font that will be used in the front matter headings
\def\fmfont{\fontsize\@xiipt{14.5}\selectfont}
\def\fmsmallfont{\fontsize\@xiipt{14pt}\selectfont}

% The year the degree will be officially conferred
\def\degreeyear#1{\gdef\@degreeyear{#1}}

% The semester (Fall or Spring) the degree will be officially conferred
\def\degreemonth#1{\gdef\@degreemonth{#1}}

% The full (unabbreviated) name of the degree
\def\degree#1{\gdef\@degree{#1}}

% The name of your committee's chair
\def\chair#1{\gdef\@chair{#1}}

% The names of your other committe members, one per line
\def\othermembers#1{\gdef\@othermembers{#1}}

% The number of committee members, which affects both the
% number of lines and the amount of space between lines
% on the approval page.
\def\@numberofmembers{3}
\def\@approvalspace{.75in}
\def\numberofmembers#1{\gdef\@numberofmembers{#1}
\ifnum \@numberofmembers > 3
\gdef\@approvalspace{.5in}
\fi}

% All previous degrees: one per line in chronological order
\def\prevdegrees#1{\gdef\@prevdegrees{#1}}

% The name of your degree's field (e.g. Psychology, Computer Science)
\def\field#1{\gdef\@field{#1}}

% acknowledge environment:
\def\acknowledgename{ACKNOWLEDGMENTS}

% abstract environment:
\def\abstractname{Abstract}

% dedication environment
\def\dedicationname{Dedication}

\def\maketitle{
{\ssp
\begin{alwayssingle}
    \let\footnotesize\small
    \let\footnoterule\relax
    \thispagestyle{empty}
    \setcounter{page}{1}

    \null\vfil
  \begin{center}
    \fmfont
    \dsp {\@title} \par \ssp
\vspace{38ex}
    By \par
    \bigskip
    {\@author} \par
\vspace{38ex}
{\ssp A thesis submitted in partial fulfillment of \par
           the requirements for the degree of \par}
\bigskip \medskip
    {\@degree} in {\@field}\par
\bigskip \medskip
\bigskip \medskip
    WASHINGTON STATE UNIVERSITY \par
    School of Electrical Engineering and Computer Science \par
\bigskip \medskip
    {\@degreemonth} {\@degreeyear}
  \end{center}

    \vfil\null
\end{alwayssingle}

\setcounter{footnote}{0}
}}

% APPROVALPAGE
%
% The \approvalpage macro emits a UC-approved approval page ready for
% your committee's signature.  It is not an automatic part of the 
% output because there's really no point in printing it until you are
% ready to get signatures.  It requires the the \year, \author, and
% \campus macros have been defined.  It uses lots of tricky spacing
% that is probably better handled with tabular environment code, but
% I'm too lazy to fix it. (EVM, 9/19/94)

\def\approvalpage{
\begin{alwayssingle}
\pagenumbering{roman}
\setcounter{page}{2}
\null\vfill
\ssp 
\begin{flushleft} To the Faculty of Washington State University: \end{flushleft} \par
\medskip
The members of the Committe appointed to examine the thesis of \\
\smallskip
{\@author} find it satisfactory and recommed that it be accepted.\\
\smallskip 

\begin{flushright}
\vspace{.25in}
\vspace{\@approvalspace}
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{0.7in} \@chair, Ph.D., Chair        ~\hspace{0.8in}
}}\:$ \\
\vspace{\@approvalspace}
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{1.05in} David E. Bakken, Ph.D.        ~\hspace{1.15in} }}\:$ \\
\vspace{\@approvalspace}
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{1.2in} Clint S. Cole, M.S. ~\hspace{1.3in} }}\:$ \\
\vspace{\@approvalspace}
\ifnum \@numberofmembers > 3
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{3.5in} }}\:$ \\
\vspace{\@approvalspace}
\fi
\ifnum \@numberofmembers > 4
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{3.5in} }}\:$ \\
\vspace{\@approvalspace}
\fi
\ifnum \@numberofmembers > 5
$\:\overline{~~~~ \mbox{\rule{0in}{0.15in}\small ~\hspace{3.5in} }}\:$ \\
\vspace{\@approvalspace}
\fi
\end{flushright}
\vfill\null
\end{alwayssingle}
}

% ACKNOWLEDGEMENTS
%
% The acknowledgements environment puts a large, bold, centered 
% "Acknowledgements" label at the top of the page.

\newenvironment{acknowledgements}
{\begin{alwayssingle}
\begin{center}
{\large \bfseries \acknowledgename}
\end{center}
}
{\end{alwayssingle}}

% DEDICATION
%
% The dedication environment just makes sure the dedication gets its
% own page.

\newenvironment{dedication}
{\begin{alwayssingle}
\null\vfill
\begin{center}
{\bfseries \dedicationname}
\bigskip \medskip \par}
{\end{center} \null\vfill \end{alwayssingle}}

% ABSTRACT
%
% The ABSTRACT environment allows for multi-page abstracts which,
% in accordance with UC rules, is numbered separately from the rest
% of the rest of the dissertation in Arabic.  It requires definition
% of the \title, \author, \degree, \field, \campus, and \chair macros.


\def\abstract{
\begin{alwayssingle}
\pagestyle{plain}
\thispagestyle{plain}
\begin{center}
{\fmfont
\vspace{.5in}
AN INTEGRATED DEVELOPMENT ENVIRONMENT FOR THE DESIGN AND \\
SIMULATION OF MEDIUM-GRAIN RECONFIGURABLE HARDWARE \par
Abstract \par
\bigskip
\bigskip
\ssp
by Kylan Thomas Robinson \\
Washington State University \\
May 2010 \\
\dsp}
\end{center}

\vspace{.1in}
\begin{flushleft}
Chair: {\@chair}
\end{flushleft}
\par
\vspace{.1in}}

\def\endabstract{\par\vfil\null\end{alwayssingle}}

% FRONTMATTER environment
%
% The FRONTMATTER environment makes sure that page numbering is set
% correctly (roman, lower-case, starting at 3) for the front matter
% that follows the abstract.  It also resets page-numbering for
% the remainder of the dissertation (arabic, starting at 1).

\newenvironment{frontmatter}
{\renewcommand{\thepage}{\roman{page}}}
{\newpage\renewcommand{\thepage}{\arabic{page}}\setcounter{page}{1}}